<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>打印合格证</title>
    <style type="text/css">
        .tg  {border-collapse:collapse;border-spacing:0;}
        .tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
        .tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
        .tg .tg-s6z2{text-align:center}
        .tg .tg-baqh{text-align:center;vertical-align:top}
    </style>

    <script language="javascript" src="jquery-1.8.3.min.js"></script>
    <script language="javascript" src="WarnPrint3.js"></script>
    <script language="javascript" src="template.js"></script>
    <script language="javascript">
    var head;
    function showAndroid(str) {
            var data = JSON.parse(str);
            head = data.headDetail;
            alert(head.fbillno);
            var loadScript = document.createElement('script');
            loadScript.setAttribute("type", "text/javascript");
            loadScript.setAttribute('src', head.fbillno);
            console.log(head.fbillno)
            document.getElementsByTagName("head")[0].appendChild(loadScript);
            //判断服务器
            if (navigator.userAgent.indexOf("IE") >= 0) {
                //IE下的事件
                loadScript.onreadystatechange = function () {
                    if (loadScript.readyState == "loaded" || loadScript.readyState == "complete") {
                        //表示加载成功
                        loadScript.onreadystatechange = null;
                        debugger;
                        callMyFun()//执行回调
                    }
                }
            }
            else {
                debugger;
                loadScript.onload = function () {
                    loadScript.onload = null;
                    debugger;
                    callMyFun();
                }
            }
      }



      function callMyFun() {
        setTimeout(function () {
            alert(head.fbillno+'里边');
            WarnPrint(head)
        }, 200);
    }
    </script>
</head>
<body >

</body>
</html>